﻿@model Gfw.Web.Models.User.UserSecondPasswordModel
@{
    ViewBag.Title = "修改二级密码";
    Layout = "~/Views/Shared/_LayoutContent.cshtml";
}

<h2 style="color:#f00">二级密码与登录密码请不要相同！</h2>
<h4 style="color:blue">二级密码默认是123</h4>
<h4 style="color:blue">请大家及时更改！</h4>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>修改二级密码</legend>

        @Html.HiddenFor(model => model.LoginName)

        <div class="editor-label">
            @Html.LabelFor(model => model.Password)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Password)
            @Html.ValidationMessageFor(model => model.Password)
        </div>

        @{
            if (!ViewBag.IsFirst)
            {
                    <div class="editor-label">
                        @Html.LabelFor(model => model.OldSecondPassword)
                    </div>
                    <div class="editor-field">
                        @Html.EditorFor(model => model.OldSecondPassword)
                        @Html.ValidationMessageFor(model => model.OldSecondPassword)
                    </div>
            }
        }


        <div class="editor-label">
            @Html.LabelFor(model => model.NewSecondPassword)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.NewSecondPassword)
            @Html.ValidationMessageFor(model => model.NewSecondPassword)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ConfirmPassword)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ConfirmPassword)
            @Html.ValidationMessageFor(model => model.ConfirmPassword)
        </div>

        <p>
            <input type="submit" value="保存" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("返回首页", "Index", "Default")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

@{
    if (ViewBag.Done != null)
    {
    <div id="dialog" title="Dialog Title">
        <h5>
            @{
        if (ViewBag.Done)
        {
                @:修改成功
            }
        else
        {
                @:修改失败
            }
            }
        </h5>
        <div>
            <button onclick="javascript:closedialog()">确定</button>
        </div>
    </div>
    <script type="text/javascript">

        $(document).ready(function () {
            $("#dialog").dialog({ title: "操作提示", modal: true });
        });

        function closedialog() {
            $("#dialog").dialog("close");
        }
    </script>
    }
}
